import { Platform } from "../base/BasePlatform";
import { PlatformManager } from "./PlatformManager";


export class LogMgr {

    private static instance: LogMgr;
    private constructor() { }
    public static getInstance(): LogMgr {
        if (this.instance == null) {
            this.instance = new LogMgr();
        }
        return this.instance;
    }
    public debug(str: string, params?: any) {
        if (PlatformManager.currentPlatform != Platform.EDITOR) {
            return
        }
        console.log(str, params ? params : "")

    }
    public logInfo(param1: any, param2?: any) {
        if (PlatformManager.currentPlatform != Platform.EDITOR) {
            return
        }
        console.log(param1, param2 ? param2 : "");

    }
    ogError(param1: any, param2?: any) {
        if (param2) {
            console.error(param1, param2)
        } else {
            console.error(param1)
        }
    }
    error(param1: string, param2?: string) {
        if (param2) {
            console.error(param1, param2)
        } else {
            console.error(param1)
        }
    }
}